hi, // Count status of requirements /************************************************************************ Counter for OPL 2010_09_01 ************************************************************************/ pragma runLim,0; // constant declarations // const string AobjectType1 = "work_progress_sv" const string AobjectType2 = "Status Kommentar" // variable declarations // Folder xF = folder "/MIB_MQB_KI/Consolidated" int x = 0 Module m = current string modName = "MQB_Kombi_OPL" Date d = today() string aus = "C:/Documents and Settings/uidt5483/Desktop/Automatismus_NEU/Status_" modName "_" d ".csv" Stream out = write aus out << "Status_MQB_Kombi_OPL" "\n\n" m = share("/MIB_MQB_KI/Consolidated/MQB_Kombi_OPL",true) Baseline b Date datum= "01 Januar 1970" /******************************************************************************************************/ for (x=50; x<=55; x+=1) { b = baseline(x,0,null) out << "\n\n" "Baseline_" major b "_" dateOf b "\n" //if (datum!=dateOf b) { level 0 datum = dateOf b /******************************************************************************************
Object o = null string oot = "" int offenCount = 0 int erledigtCount = 0 int abgelehntCount = 0 int inarbeitCount = 0 int i = 0 out << "\n\n" "Status of Attribute:" ";"";" AobjectType1 "\n\n" "offen " ";" "erledigt " ";" "abgelehnt " ";" "in Arbeit " "\n" if !exists attribute AobjectType1 then { print "Atribute not found" } level 0 // main program // for o in m do { oot = o.AobjectType1 if oot == "offen" then offenCount ++ else if oot == "erledigt" then erledigtCount ++ else if oot == "abgelehnt" then abgelehntCount ++ else if oot == "in Arbeit" then inarbeitCount ++ } out << offenCount ";" erledigtCount ";" abgelehntCount ";" inarbeitCount "\n\n" oot = "" o = null offenCount = 0 erledigtCount = 0 abgelehntCount = 0 inarbeitCount = 0 /******************************************************************************************
o = null oot = "" offenCount = 0 erledigtCount = 0 abgelehntCount = 0 inarbeitCount = 0 out <<"\n" "Status of Attribute:" ";"";" AobjectType1 "\n\n" "offen " ";" "erledigt " ";" "abgelehnt " "\n" if !exists attribute AobjectType2 then { print "Atribute not found" } level 0 // main program // for o in m do { oot = o.AobjectType2 if oot == "offen" then offenCount ++ else if oot == "erledigt" then erledigtCount ++ else if oot == "abgelehnt" then abgelehntCount ++ } out << offenCount ";" erledigtCount ";" abgelehntCount "\n\n\n" oot = "" o = null offenCount = 0 erledigtCount = 0 abgelehntCount = 0 } load(m,b,false) } close out print "finished..." Reudaeaeae - Mon Sep 06 08:36:21 EDT 2010 |
Re: Baselines
First: Please use the "{ C O D E }" statement to post code, so that the formatting does not get lost. It helps a lot, especially with larger code parts. m = load(m,b,false)
load(m,b,false)
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Baselines Mathias Mamsch - Mon Sep 06 09:46:28 EDT 2010
First: Please use the "{ C O D E }" statement to post code, so that the formatting does not get lost. It helps a lot, especially with larger code parts. m = load(m,b,false)
load(m,b,false)
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
thx mathias but no, it doesn´t help...
Object o = null
string oot = ""
int offenCount = 0
int erledigtCount = 0
int abgelehntCount = 0
int inarbeitCount = 0
int i = 0
out << "\n\n" "Status of Attribute:" ";"";" AobjectType1 "\n\n" "offen " ";" "erledigt " ";" "abgelehnt " ";" "in Arbeit " "\n"
if !exists attribute AobjectType1 then
{
print "Atribute not found"
}
level 0
// main program //
for o in m do
{
oot = o.AobjectType1
if oot == "offen" then offenCount ++ else
if oot == "erledigt" then erledigtCount ++ else
if oot == "abgelehnt" then abgelehntCount ++ else
if oot == "in Arbeit" then inarbeitCount ++
}
out << offenCount ";" erledigtCount ";" abgelehntCount ";" inarbeitCount "\n\n"
oot = ""
o = null
offenCount = 0
erledigtCount = 0
abgelehntCount = 0
inarbeitCount = 0
/******************************************************************************************
* *
* first Attribute end - second Attribute start *
* *
******************************************************************************************/
o = null
oot = ""
offenCount = 0
erledigtCount = 0
abgelehntCount = 0
inarbeitCount = 0
out <<"\n" "Status of Attribute:" ";"";" AobjectType1 "\n\n" "offen " ";" "erledigt " ";" "abgelehnt " "\n"
if !exists attribute AobjectType2 then
{
print "Atribute not found"
}
level 0
// main program //
for o in m do
{
oot = o.AobjectType2
if oot == "offen" then offenCount ++ else
if oot == "erledigt" then erledigtCount ++ else
if oot == "abgelehnt" then abgelehntCount ++
}
out << offenCount ";" erledigtCount ";" abgelehntCount "\n\n\n"
oot = ""
o = null
offenCount = 0
erledigtCount = 0
abgelehntCount = 0
const string AobjectType1 = "work_progress_sv"
const string AobjectType2 = "Status Kommentar"
// variable declarations //
Folder xF = folder "/MIB_MQB_KI/Consolidated"
int x = 0
Module m = current
string modName = "MQB_Kombi_OPL"
Date d = today()
string aus = "C:/Documents and Settings/uidt5483/Desktop/Automatismus_NEU/Status_" modName "_" d ".csv"
Stream out = write aus
out << "Status_MQB_Kombi_OPL" "\n\n"
m = share("/MIB_MQB_KI/Consolidated/MQB_Kombi_OPL",true)
Baseline b
Date datum= "01 Januar 1970"
/******************************************************************************************************/
for (x=50; x<=55; x+=1)
{
b = baseline(x,0,null)
out << "\n\n" "Baseline_" major b "_" dateOf b "\n"
//if (datum!=dateOf b)
{
level 0
datum = dateOf b
m = load(m,b,false)
|
Re: Baselines Reudaeaeae - Mon Sep 06 10:04:54 EDT 2010
thx mathias but no, it doesn´t help...
Object o = null
string oot = ""
int offenCount = 0
int erledigtCount = 0
int abgelehntCount = 0
int inarbeitCount = 0
int i = 0
out << "\n\n" "Status of Attribute:" ";"";" AobjectType1 "\n\n" "offen " ";" "erledigt " ";" "abgelehnt " ";" "in Arbeit " "\n"
if !exists attribute AobjectType1 then
{
print "Atribute not found"
}
level 0
// main program //
for o in m do
{
oot = o.AobjectType1
if oot == "offen" then offenCount ++ else
if oot == "erledigt" then erledigtCount ++ else
if oot == "abgelehnt" then abgelehntCount ++ else
if oot == "in Arbeit" then inarbeitCount ++
}
out << offenCount ";" erledigtCount ";" abgelehntCount ";" inarbeitCount "\n\n"
oot = ""
o = null
offenCount = 0
erledigtCount = 0
abgelehntCount = 0
inarbeitCount = 0
/******************************************************************************************
* *
* first Attribute end - second Attribute start *
* *
******************************************************************************************/
o = null
oot = ""
offenCount = 0
erledigtCount = 0
abgelehntCount = 0
inarbeitCount = 0
out <<"\n" "Status of Attribute:" ";"";" AobjectType1 "\n\n" "offen " ";" "erledigt " ";" "abgelehnt " "\n"
if !exists attribute AobjectType2 then
{
print "Atribute not found"
}
level 0
// main program //
for o in m do
{
oot = o.AobjectType2
if oot == "offen" then offenCount ++ else
if oot == "erledigt" then erledigtCount ++ else
if oot == "abgelehnt" then abgelehntCount ++
}
out << offenCount ";" erledigtCount ";" abgelehntCount "\n\n\n"
oot = ""
o = null
offenCount = 0
erledigtCount = 0
abgelehntCount = 0
const string AobjectType1 = "work_progress_sv"
const string AobjectType2 = "Status Kommentar"
// variable declarations //
Folder xF = folder "/MIB_MQB_KI/Consolidated"
int x = 0
Module m = current
string modName = "MQB_Kombi_OPL"
Date d = today()
string aus = "C:/Documents and Settings/uidt5483/Desktop/Automatismus_NEU/Status_" modName "_" d ".csv"
Stream out = write aus
out << "Status_MQB_Kombi_OPL" "\n\n"
m = share("/MIB_MQB_KI/Consolidated/MQB_Kombi_OPL",true)
Baseline b
Date datum= "01 Januar 1970"
/******************************************************************************************************/
for (x=50; x<=55; x+=1)
{
b = baseline(x,0,null)
out << "\n\n" "Baseline_" major b "_" dateOf b "\n"
//if (datum!=dateOf b)
{
level 0
datum = dateOf b
m = load(m,b,false)
Hmm without testing your code - you can use a code skeleton like this for your evaluations:
void exportStatistics (Module m, Stream out) {
print "Exporting statistics for module " (name m ) " " (versionString moduleVersion m) "\n"
Object o
for o in m do {
// do your counting and exporting to the stream in here ...
}
}
// replace this by the output file ...
Stream out = null // write "C:\\temp\\file.txt"
// how many baselines do you want to process?
const int LAST_BASELINES_TO_PROCESS = 5
// Do this for the current module. Make this any other module if you want.
Module m = current
Baseline b
Skip sk = create();
int count = 0;
// Put the baselines to a skip list in reverse order
for b in m do { put (sk, --count, b) }
// Add the current module as the first one
put (sk, --count, null Baseline)
count = 0
// Process the skip list (current module comes first, then the baselines in "latest first" order
for b in sk do {
Module modProcessed
// Load the baseline or use the current module ...
if (null b) {
modProcessed = m
} else {
modProcessed = load(m, b, false)
}
// Enter your code to create the statistics here
exportStatistics (modProcessed, out)
// close the baseline
if (modProcessed != m) close modProcessed
// process only the last LAST_BASELINES_TO_PROCESS baselines
if (++count == LAST_BASELINES_TO_PROCESS) break
}
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Baselines Mathias Mamsch - Mon Sep 06 10:35:42 EDT 2010
Hmm without testing your code - you can use a code skeleton like this for your evaluations:
void exportStatistics (Module m, Stream out) {
print "Exporting statistics for module " (name m ) " " (versionString moduleVersion m) "\n"
Object o
for o in m do {
// do your counting and exporting to the stream in here ...
}
}
// replace this by the output file ...
Stream out = null // write "C:\\temp\\file.txt"
// how many baselines do you want to process?
const int LAST_BASELINES_TO_PROCESS = 5
// Do this for the current module. Make this any other module if you want.
Module m = current
Baseline b
Skip sk = create();
int count = 0;
// Put the baselines to a skip list in reverse order
for b in m do { put (sk, --count, b) }
// Add the current module as the first one
put (sk, --count, null Baseline)
count = 0
// Process the skip list (current module comes first, then the baselines in "latest first" order
for b in sk do {
Module modProcessed
// Load the baseline or use the current module ...
if (null b) {
modProcessed = m
} else {
modProcessed = load(m, b, false)
}
// Enter your code to create the statistics here
exportStatistics (modProcessed, out)
// close the baseline
if (modProcessed != m) close modProcessed
// process only the last LAST_BASELINES_TO_PROCESS baselines
if (++count == LAST_BASELINES_TO_PROCESS) break
}
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Baselines Reudaeaeae - Tue Sep 07 04:41:48 EDT 2010
one last question...
pragma runLim,0;
Folder xF = folder "/MIB_MQB_KI/Consolidated"
/****************************************************************************************************/
void exportStatistics (Module m, Stream out)
{
Object o
string oot = ""
int offenCount = 0
int erledigtCount = 0
int abgelehntCount = 0
int inarbeitCount = 0
int i = 0
const string AobjectType1 = "work_progress_sv"
const string AobjectType2 = "Status Kommentar"
if(versionString moduleVersion m=="")
{
out << "Module_version:" ";"";" "current"
}
else
{
out << "Module Version:" ";"";" (versionString moduleVersion m)
}
/************************first Attribute start*****************************************************/
out << "\n\n" "Status of Attribute:" ";"";" AobjectType1 "\n\n" "offen " ";" "erledigt " ";" "abgelehnt " ";" "in Arbeit " "\n"
if !exists attribute AobjectType1 then
{
print "Atribute not found"
}
level 0
for o in m do
{
oot = o.AobjectType1
if oot == "offen" then offenCount ++ else
if oot == "erledigt" then erledigtCount ++ else
if oot == "abgelehnt" then abgelehntCount ++ else
if oot == "in Arbeit" then inarbeitCount ++
}
out << offenCount ";" erledigtCount ";" abgelehntCount ";" inarbeitCount "\n"
oot = ""
o = null
offenCount = 0
erledigtCount = 0
abgelehntCount = 0
inarbeitCount = 0
/*****************first Attribute end - second Attribute start****************************************/
out <<"\n" "Status of Attribute:" ";"";" AobjectType2 "\n\n" "offen " ";" "erledigt " ";" "abgelehnt " "\n"
if !exists attribute AobjectType2 then
{
print "Atribute not found"
}
level 0
for o in m do
{
oot = o.AobjectType2
if oot == "offen" then offenCount ++ else
if oot == "erledigt" then erledigtCount ++ else
if oot == "abgelehnt" then abgelehntCount ++
}
out << offenCount ";" erledigtCount ";" abgelehntCount "\n\n\n"
oot = ""
o = null
offenCount = 0
erledigtCount = 0
abgelehntCount = 0
}
/*************************************************************************************************************/
Date d = today()
string modname = "MQB_Kombi_OPL"
// replace this by the output file ...
Stream out = write "C:/Documents and Settings/uidt5483/Desktop/Automatismus_NEU/Status_" modname "_" d ".csv"
/****************************************************************************************************************/
// how many baselines do you want to process?
const int LAST_BASELINES_TO_PROCESS = 5
// Do this for the current module. Make this any other module if you want.
Module m = share("/MIB_MQB_KI/Consolidated/MQB_Kombi_OPL",false)
Baseline b
Skip sk = create();
int count = 0;
/********************************************************************************************************************/
// Put the baselines to a skip list in reverse order
for b in m do { put (sk, --count, b) }
// Add the current module as the first one
put (sk, --count, null Baseline)
count = 0
// Process the skip list (current module comes first, then the baselines in "latest first" order
for b in sk do {
Module modProcessed
// Load the baseline or use the current module ...
if (null b) {
modProcessed = m
} else {
modProcessed = load(m, b, false)
}
// Enter your code to create the statistics here
exportStatistics (modProcessed, out)
// close the baseline
if (modProcessed != m) close modProcessed
// process only the last LAST_BASELINES_TO_PROCESS baselines
if (++count == LAST_BASELINES_TO_PROCESS) break
}
|
Re: Baselines Reudaeaeae - Tue Sep 07 04:56:56 EDT 2010
one last question...
pragma runLim,0;
Folder xF = folder "/MIB_MQB_KI/Consolidated"
/****************************************************************************************************/
void exportStatistics (Module m, Stream out)
{
Object o
string oot = ""
int offenCount = 0
int erledigtCount = 0
int abgelehntCount = 0
int inarbeitCount = 0
int i = 0
const string AobjectType1 = "work_progress_sv"
const string AobjectType2 = "Status Kommentar"
if(versionString moduleVersion m=="")
{
out << "Module_version:" ";"";" "current"
}
else
{
out << "Module Version:" ";"";" (versionString moduleVersion m)
}
/************************first Attribute start*****************************************************/
out << "\n\n" "Status of Attribute:" ";"";" AobjectType1 "\n\n" "offen " ";" "erledigt " ";" "abgelehnt " ";" "in Arbeit " "\n"
if !exists attribute AobjectType1 then
{
print "Atribute not found"
}
level 0
for o in m do
{
oot = o.AobjectType1
if oot == "offen" then offenCount ++ else
if oot == "erledigt" then erledigtCount ++ else
if oot == "abgelehnt" then abgelehntCount ++ else
if oot == "in Arbeit" then inarbeitCount ++
}
out << offenCount ";" erledigtCount ";" abgelehntCount ";" inarbeitCount "\n"
oot = ""
o = null
offenCount = 0
erledigtCount = 0
abgelehntCount = 0
inarbeitCount = 0
/*****************first Attribute end - second Attribute start****************************************/
out <<"\n" "Status of Attribute:" ";"";" AobjectType2 "\n\n" "offen " ";" "erledigt " ";" "abgelehnt " "\n"
if !exists attribute AobjectType2 then
{
print "Atribute not found"
}
level 0
for o in m do
{
oot = o.AobjectType2
if oot == "offen" then offenCount ++ else
if oot == "erledigt" then erledigtCount ++ else
if oot == "abgelehnt" then abgelehntCount ++
}
out << offenCount ";" erledigtCount ";" abgelehntCount "\n\n\n"
oot = ""
o = null
offenCount = 0
erledigtCount = 0
abgelehntCount = 0
}
/*************************************************************************************************************/
Date d = today()
string modname = "MQB_Kombi_OPL"
// replace this by the output file ...
Stream out = write "C:/Documents and Settings/uidt5483/Desktop/Automatismus_NEU/Status_" modname "_" d ".csv"
/****************************************************************************************************************/
// how many baselines do you want to process?
const int LAST_BASELINES_TO_PROCESS = 5
// Do this for the current module. Make this any other module if you want.
Module m = share("/MIB_MQB_KI/Consolidated/MQB_Kombi_OPL",false)
Baseline b
Skip sk = create();
int count = 0;
/********************************************************************************************************************/
// Put the baselines to a skip list in reverse order
for b in m do { put (sk, --count, b) }
// Add the current module as the first one
put (sk, --count, null Baseline)
count = 0
// Process the skip list (current module comes first, then the baselines in "latest first" order
for b in sk do {
Module modProcessed
// Load the baseline or use the current module ...
if (null b) {
modProcessed = m
} else {
modProcessed = load(m, b, false)
}
// Enter your code to create the statistics here
exportStatistics (modProcessed, out)
// close the baseline
if (modProcessed != m) close modProcessed
// process only the last LAST_BASELINES_TO_PROCESS baselines
if (++count == LAST_BASELINES_TO_PROCESS) break
}
You can try something like the below. Regards, Mathias
// ... lots of code ...
// lets store the dates of the baselines we already processed ...
Skip processedDates = createString()
for b in sk do {
Module modProcessed
// get the date of the baseline
Date dateBS = dateOf b
string strDateBS = dateBS ""
// if we already had a baseline with that date, continue
if (find(processedDates, strDateBS)) continue
// continue and store the date as an already processed date
put(processedDates, strDateBS, 0)
// ... more code ...
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|